home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-04 | 2.2 KB | 83 lines | [TEXT/KAHL] |
- /********************************************************* DEFINITION
- DATE: 9/17/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPSpawnConfirmTask
-
- SUPERCLASS: CPPPeriodicTask
-
- This C++ class periodically spawns a ConfirmUsers Task
-
- ********************************************************************/
-
- #include "CPPSpawnConfirmTask.h"
- #include "CPPConfirmUsers.h"
- #include "CPPTaskManager.h"
-
- /*-----------------------------------------------------------------*/
- /*------------------------ PUBLIC METHODS -------------------------*/
- /*-----------------------------------------------------------------*/
-
- CPPSpawnConfirmTask::CPPSpawnConfirmTask (CPPTaskManager *TaskManager,
- long minPeriod,
- Boolean deleteWhenDone) :
- CPPPeriodicTask (TaskManager, minPeriod,
- deleteWhenDone)
- {
- this->confirmTask = NULL;
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPSpawnConfirmTask::~CPPSpawnConfirmTask (void)
- {
- delete confirmTask;
- }
-
- /*-----------------------------------------------------------------*/
-
- char *CPPSpawnConfirmTask::ClassName (void)
- {
- return "CPPSpawnConfirmTask";
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPSpawnConfirmTask::DoPeriodicAction (void)
- {
- // call the inherited method to update frequency count
- CPPPeriodicTask::DoPeriodicAction();
-
- if (confirmTask->hasCompleted)
- confirmTask->StartConfirmUsers (NULL);
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPSpawnConfirmTask::DoCompletedAction (void)
- {
- CPPPeriodicTask::DoCompletedAction();
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPSpawnConfirmTask::StartSpawnConfirmTask
- (CompletionProc DoProc)
- {
- if (!this->hasCompleted)
- return;
-
- if (!confirmTask)
- confirmTask = new CPPConfirmUsers (this->ourManager,
- 60, FALSE);
-
- // note that we haven't completed yet
- SetCompletionProc(DoProc);
- this->hasCompleted = FALSE;
-
- // add ourselves to the periodic task queue
- this->ourManager->AddPeriodicTask(this);
- }
-
- /*-----------------------------------------------------------------*/
-